package com.ruoyi.easyfame.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.easyfame.mapper.DemandManagementsMapper;
import com.ruoyi.easyfame.domain.DemandManagements;
import com.ruoyi.easyfame.service.IDemandManagementsService;

/**
 * 需求管理记录Service业务层处理
 * 
 * @author xhb
 * @date 2025-08-27
 */
@Service
public class DemandManagementsServiceImpl implements IDemandManagementsService 
{
    @Autowired
    private DemandManagementsMapper demandManagementsMapper;

    /**
     * 查询需求管理记录
     * 
     * @param id 需求管理记录主键
     * @return 需求管理记录
     */
    @Override
    public DemandManagements selectDemandManagementsById(Long id)
    {
        return demandManagementsMapper.selectDemandManagementsById(id);
    }

    /**
     * 查询需求管理记录列表
     * 
     * @param demandManagements 需求管理记录
     * @return 需求管理记录
     */
    @Override
    public List<DemandManagements> selectDemandManagementsList(DemandManagements demandManagements)
    {
        return demandManagementsMapper.selectDemandManagementsList(demandManagements);
    }

    /**
     * 新增需求管理记录
     * 
     * @param demandManagements 需求管理记录
     * @return 结果
     */
    @Override
    public int insertDemandManagements(DemandManagements demandManagements)
    {
        demandManagements.setCreateTime(DateUtils.getNowDate());
        return demandManagementsMapper.insertDemandManagements(demandManagements);
    }

    /**
     * 修改需求管理记录
     * 
     * @param demandManagements 需求管理记录
     * @return 结果
     */
    @Override
    public int updateDemandManagements(DemandManagements demandManagements)
    {
        demandManagements.setUpdateTime(DateUtils.getNowDate());
        return demandManagementsMapper.updateDemandManagements(demandManagements);
    }

    /**
     * 批量删除需求管理记录
     * 
     * @param ids 需要删除的需求管理记录主键
     * @return 结果
     */
    @Override
    public int deleteDemandManagementsByIds(Long[] ids)
    {
        return demandManagementsMapper.deleteDemandManagementsByIds(ids);
    }

    /**
     * 删除需求管理记录信息
     * 
     * @param id 需求管理记录主键
     * @return 结果
     */
    @Override
    public int deleteDemandManagementsById(Long id)
    {
        return demandManagementsMapper.deleteDemandManagementsById(id);
    }
}
